package properties_db

type Mysql struct {
	GeneralDB `yaml:",inline" mapstructure:",squash"`
}

func (m *Mysql) Dsn(testConn bool) string {
	s := m.Username + ":" + m.Password + "@tcp(" + m.Path
	if m.Port != "" {
		s += ":" + m.Port
	}
	s += ")/"
	if m.Dbname != "" {
		s += m.Dbname
	}
	if m.Config != "" {
		s += "?" + m.Config
	}
	return s
}
